package com.robcity.platform.convert;

import com.robcity.platform.dto.RobotEventInfoSaveDTO;
import com.robcity.platform.entities.RobotEventInfo;
import com.robcity.platform.vo.RobotEventInfoVO;


/**
 * @Description
 * @Author zhangsong
 * @Date 2024/8/10
 **/
public class RobotEventInfoConvert {
    public static RobotEventInfo DTO2RobotEventInfo(RobotEventInfoSaveDTO robotEventInfoSaveDTO) {
        RobotEventInfo robotEventInfo = new RobotEventInfo();
        robotEventInfo.setRobId(robotEventInfoSaveDTO.getRobId());
        robotEventInfo.setTimeStemp(robotEventInfoSaveDTO.getTimeStemp());
        robotEventInfo.setEventType(robotEventInfoSaveDTO.getEventType());
        robotEventInfo.setOccurLat(robotEventInfoSaveDTO.getOccurLat());
        robotEventInfo.setOccurLon(robotEventInfoSaveDTO.getOccurLon());
        robotEventInfo.setHandelStatus(robotEventInfoSaveDTO.getHandelStatus());
        robotEventInfo.setTaskId(robotEventInfoSaveDTO.getTaskId());
        robotEventInfo.setTaskType(robotEventInfoSaveDTO.getTaskType());
        return robotEventInfo;
    }
    public static RobotEventInfoVO RobotEventInfo2RobotEventInfoVO(RobotEventInfo robotEventInfo) {
        if (robotEventInfo == null){
            return null;
        }
        RobotEventInfoVO robotEventInfoVO = new RobotEventInfoVO();
        robotEventInfoVO.setId(robotEventInfo.getId());
        robotEventInfoVO.setRobId(robotEventInfo.getRobId());
        robotEventInfoVO.setTimeStemp(robotEventInfo.getTimeStemp());
        robotEventInfoVO.setEventType(robotEventInfo.getEventType());
        robotEventInfoVO.setOccurLat(robotEventInfo.getOccurLat());
        robotEventInfoVO.setOccurLon(robotEventInfo.getOccurLon());
        robotEventInfoVO.setHandelStatus(robotEventInfo.getHandelStatus());
        robotEventInfoVO.setCreateTime(robotEventInfo.getCreateTime());
        robotEventInfoVO.setTaskId(robotEventInfo.getTaskId());
        robotEventInfoVO.setTaskType(robotEventInfo.getTaskType());
        return robotEventInfoVO;

    }
}
